//Copyright (c) Microsoft Corporation.  All rights reserved.

#pragma once
#include "D3D10EffectVariable.h"

namespace  Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace Direct3D10 {

using namespace System;

    /// <summary>
    /// A matrix-variable interface accesses a matrix.
    /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable)</para>
    /// </summary>
    public ref class EffectMatrixVariable :
        public EffectVariable
    {
    public: 
        /// <summary>
        /// Get a matrix.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::GetMatrix)</para>
        /// </summary>
        /// <returns>The matrix as a float array.</returns>
        array<Single>^ GetMatrix();

        /// <summary>
        /// Get a two dimentional array of matrices.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::GetMatrixArray)</para>
        /// </summary>
        /// <param name="offset">The offset (in number of matrices) between the start of the array and the first matrix returned.</param>
        /// <param name="count">The number of matrices requested in the returned collection.</param>
        /// <returns>A two dimentional array of matrices.</returns>
        array<Single,2>^ GetMatrixArray(UInt32 offset, UInt32 count);

        /// <summary>
        /// Transpose and get a floating-point matrix.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::GetMatrixTranspose)</para>
        /// </summary>
        /// <returns>The transposed matrix.</returns>
        array<Single>^ GetMatrixTranspose();

        /// <summary>
        /// Transpose and get a two dimentional array of floating-point matrices.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::GetMatrixTransposeArray)</para>
        /// </summary>
        /// <param name="offset">The offset (in number of matrices) between the start of the array and the first matrix to get.</param>
        /// <param name="count">The number of matrices in the array to get.</param>
        /// <returns>A two dimentional array of tranposed matrices.</returns>
        array<Single,2>^ GetMatrixTransposeArray(UInt32 offset, UInt32 count);

        /// <summary>
        /// Set a floating-point matrix.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::SetMatrix)</para>
        /// </summary>
        /// <param name="data">The matrix.</param>
        void SetMatrix(array<Single>^ data);

        /// <summary>
        /// Set a two dimentional array of floating-point matrices.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::SetMatrixArray)</para>
        /// </summary>
        /// <param name="data">The matrix two dimentional array.</param>
        /// <param name="offset">The number of matrix elements to skip from the start of the array.</param>
        void SetMatrixArray(array<Single,2>^ data, UInt32 offset);

        /// <summary>
        /// Transpose and set a floating-point matrix.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::SetMatrixTranspose)</para>
        /// </summary>
        /// <param name="data">The matrix.</param>
        void SetMatrixTranspose(array<Single>^ data);

        /// <summary>
        /// Transpose and set a two dimentional array of floating-point matrices.
        /// <para>(Also see DirectX SDK: ID3D10EffectMatrixVariable::SetMatrixTransposeArray)</para>
        /// </summary>
        /// <param name="data">A two dimentional array of matrices.</param>
        /// <param name="offset">The offset (in number of matrices) between the start of the array and the first matrix to set.</param>
        void SetMatrixTransposeArray(array<Single,2>^ data, UInt32 offset);
    public protected:
        EffectMatrixVariable()
        {
        }
    internal:

        EffectMatrixVariable(ID3D10EffectMatrixVariable* pNativeID3D10EffectMatrixVariable) : 
            EffectVariable(pNativeID3D10EffectMatrixVariable)
        { }


        EffectMatrixVariable(ID3D10EffectMatrixVariable* pNativeID3D10EffectMatrixVariable, bool deletable) : 
            EffectVariable(pNativeID3D10EffectMatrixVariable, deletable)
        { }

    };
} } } }
